class ErpOddNumbersEntity {
  List<ErpOddNumbersData> datas;

  ErpOddNumbersEntity({this.datas});

  ErpOddNumbersEntity.fromJson(Map<String, dynamic> json) {
    if (json['datas'] != null) {
      datas = new List<ErpOddNumbersData>();
      (json['datas'] as List).forEach((v) {
        datas.add(new ErpOddNumbersData.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.datas != null) {
      data['datas'] = this.datas.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class ErpOddNumbersData {
  String erpno;
  List<ErpOddNumbersDatasDetail> details;

  ErpOddNumbersData({this.erpno, this.details});

  ErpOddNumbersData.fromJson(Map<String, dynamic> json) {
    erpno = json['erpno'];
    if (json['details'] != null) {
      details = new List<ErpOddNumbersDatasDetail>();
      (json['details'] as List).forEach((v) {
        details.add(new ErpOddNumbersDatasDetail.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['erpno'] = this.erpno;
    if (this.details != null) {
      data['details'] = this.details.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class ErpOddNumbersDatasDetail {
  String baseunitname;
  dynamic note;
  String batchno;
  String projectname;
  double amount;
  String materialname;
  int quantity;
  dynamic bigcode;
  String bigname;
  String materialcode;
  dynamic middlecode;
  String supplierno;
  String middlename;
  String spec;
  String suppliername;
  String smallcode;
  String projectno;
  int qty;
  int operationqty;
  dynamic imageurl;
  String smallname;
  String model;
  dynamic department;
  String id;
  dynamic unitprice;
  String zhtbh;
  String ebeln;
  String ebelp;
  String epdeldate;
  String epdardate;
  String spcode;

  ErpOddNumbersDatasDetail(
      {this.baseunitname,
      this.note,
      this.batchno,
      this.projectname,
      this.amount,
      this.materialname,
      this.quantity,
      this.bigcode,
      this.bigname,
      this.materialcode,
      this.middlecode,
      this.supplierno,
      this.middlename,
      this.spec,
      this.suppliername,
      this.smallcode,
      this.projectno,
      this.qty,
      this.imageurl,
      this.smallname,
      this.model,
      this.department,
      this.id,
      this.unitprice,
      this.operationqty,
      this.ebeln,
      this.ebelp,
      this.epdardate,
      this.epdeldate,
      this.spcode,
      this.zhtbh});

  ErpOddNumbersDatasDetail.fromJson(Map<String, dynamic> json) {
    baseunitname = json['baseunitname'];
    note = json['note'];
    batchno = json['batchno'];
    projectname = json['projectname'];
    amount = json['amount'];
    materialname = json['materialname'];
    quantity = json['quantity'].toInt();
    bigcode = json['bigcode'];
    bigname = json['bigname'];
    materialcode = json['materialcode'];
    middlecode = json['middlecode'];
    supplierno = json['supplierno'];
    middlename = json['middlename'];
    spec = json['spec'];
    suppliername = json['suppliername'];
    smallcode = json['smallcode'];
    projectno = json['projectno'];
    if(json['operationqty']==null){
      operationqty = 0;
    }else{
      operationqty = json['operationqty'].toInt();
    }
    if(json['qty']==null){
      qty = json['quantity'].toInt();
    }else{
      qty = json['qty'].toInt();
    }
    imageurl = json['imageurl'];
    smallname = json['smallname'];
    model = json['model'];
    department = json['department'];
    id = json['id'];
    unitprice = json['unitprice'];
    zhtbh = json['zhtbh'];
    ebeln = json['ebeln'];
    ebelp = json['ebelp'];
    epdeldate = json['epdeldate'];
    epdardate = json['epdardate'];
    spcode = json['spcode'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['baseunitname'] = this.baseunitname;
    data['note'] = this.note;
    data['batchno'] = this.batchno;
    data['projectname'] = this.projectname;
    data['amount'] = this.amount;
    data['materialname'] = this.materialname;
    data['recqty'] = this.quantity;
    data['bigcode'] = this.bigcode;
    data['bigname'] = this.bigname;
    data['materialcode'] = this.materialcode;
    data['middlecode'] = this.middlecode;
    data['supplierno'] = this.supplierno;
    data['middlename'] = this.middlename;
    data['spec'] = this.spec;
    data['suppliername'] = this.suppliername;
    data['smallcode'] = this.smallcode;
    data['projectno'] = this.projectno;
    data['qty'] = this.qty;
    data['operationqty'] = this.operationqty;
    data['imageurl'] = this.imageurl;
    data['smallname'] = this.smallname;
    data['model'] = this.model;
    data['department'] = this.department;
    data['erpdetailid'] = this.id;
    data['unitprice'] = this.unitprice;
    data['zhtbh'] = this.zhtbh;
    data['ebeln'] = this.ebeln;
    data['ebelp'] = this.ebelp;
    data['epdeldate'] = this.epdeldate;
    data['epdardate'] = this.epdardate;
    data['spcode'] = this.spcode;
    return data;
  }
}
